package com.tao.factorys;

import com.tao.pojo.Answerer;
import com.tao.utils.UUIDUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.UUID;

/**
 * @Author: alubus
 * @Date: 2021/11/15 18:18
 * @Package: com.tao.factorys
 */
@Component
public class AnswererFactory {
    @Autowired
    UUIDUtils uuidUtils;

    private Answerer nullAnswerer;

    public Answerer getNullAnswerer(){
        this.nullAnswerer=this.getAnswerer("null",0,"null","123","数据为空","类别无");
        return nullAnswerer;
    }

    public  Answerer getAnswerer(String name,Integer age ,String email,String pwd,String data,String calssify){
        Answerer answerer = new Answerer();
        answerer.setName(name);
        answerer.setAge(age);
        answerer.setEmail(email);
        answerer.setPassword(pwd);
        answerer.setAnswersum(0);
        answerer.setHead(null);
        answerer.setData(data);
        answerer.setClassify(calssify);
        return answerer;
    }

    public  Answerer getAnswerer(@RequestParam String name, @RequestParam String pwd){
        return this.getAnswerer(name,18,"xxx00@qq.com",pwd,"没啥好说的","类别无");
    }

    public  Answerer getAnswerer(){
      return   this.getAnswerer(uuidUtils.get16UUID(),"12345678");
    }

}
